// index.js
require([
	'./components/swiper',
	'./components/header.scroll',
	'./components/ui.tab',
	'backbone'],
	function(
		SwiperView,
		HeaderScroll,
		UITab,
		Backbone
	) {

	var View = Backbone.View.extend({
		el: '#app',
		initialize: function() {
			this.initHeaderScroll();
			this.initAdSwiper();
			this.initListSwiper();
			this.initUITab();
		},
		// 初始化头部滚动
		initHeaderScroll: function() {
			this.HeaderScroll = new HeaderScroll({
				banner: '.index-ad-swiper'
			});
		},
		// 初始化轮播图
		initAdSwiper: function() {
			this.AdSwiper = new SwiperView({
				el: this.$('.index-ad-swiper'),
				pagination: '.swiper-pagination',
				autoplay: 3000,
				autoplayDisableOnInteraction: false
			});
		},
		initListSwiper: function() {
			this.LiseSwiper = new SwiperView({
				el: this.$("#j_video_list"),
				slidesPerView: 'auto'
			})
		},
		// 初始化tab
		initUITab: function() {
			this.UITab = new UITab();
		}
	});

	new View();
});